<div class="navbar">
    <div class="navbar-inner">
        <ul class="nav pull-right">

            <!--            <li><a href="#" class="hidden-phone visible-tablet visible-desktop" role="button">Settings</a></li>-->
<!--            <li><img src="111" style="height: 40px;width: 40px;"></li>-->
            <li id="fat-menu" class="dropdown">
                <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
                    <i class="icon-user"></i> {$Request.session.u_username}
                    <i class="icon-caret-down"></i>
                </a>
                

                <ul class="dropdown-menu">
                    <!--                    <li><a tabindex="-1" href="#">My Account</a></li>-->
                    <!--                    <li class="divider"></li>-->
                    
                    <li><a tabindex="-1" class="visible-phone" href="#"> {$Request.session.u_username}</a></li>
                    <li class="divider visible-phone"></li>
                    <li class="logout"><a tabindex="-1" style="cursor: pointer">退出</a></li>
                </ul>
            </li>

        </ul>
        <?php       
        $intername = db("config")->where("id=1")->value("name");       
        ?>
        <a class="brand" href="{:url('/admin/Index')}"><span class="second">{$intername}</span></a>
    </div>
</div>
<script>
    $(".logout").click(function () {

        layer.confirm('确认退出吗？', {
            btn: ['确认', '取消'] //按钮
        }, function (index) {

            layer.close(index);

            layer.load(1, {
                shade: [0.2, '#fff'], //0.1透明度的白色背景
                time: 1000
            });
            setTimeout(function () {
                window.location.href = "{:url('/admin/Login/logout')}";//注销登录
            }, 1000);


//            layer.msg('的确很重要', {icon: 1});
        }, function () {

//            layer.msg('也可以这样', {
//                time: 20000, //20s后自动关闭
//                btn: ['明白了', '知道了']
//            });
        });



    });
</script>
